<%@ page import="main.www.wonderfuldata.com.StatementTest" %>
<%@ page import="main.www.wonderfuldata.bean.User2" %>
<%@ page import="java.util.List" %>


<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: gby0564
  Date: 2022/4/22
  Time: 10:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <title>登陆成功页面</title>

    <link rel="stylesheet" href="CSS/table.css">
</head>
<body>

    <%
        String name = request.getParameter("name");
        System.out.println(name);
    %>

    <h1>登陆成功页面</h1>
    <a href="selectUserInfo.jsp">查询用户信息表</a>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>

    <%
        List<String> list = new ArrayList<String>();
        list.add("简单是可靠的先决条件");
        list.add("兴趣是最好的老师");
        list.add("知识上的投资总能得到最好的回报");
        request.setAttribute("list", list);
    %>
    <%
        String sql = "select *from User";
        StatementTest st = new StatementTest();
        List<User2> list2  = st.getAllInstance(User2.class,sql);
        request.setAttribute("list2", list2);


    %>




    <%



    %>

    <b>遍历List集合的全部元素：</b>
    <br>
    <c:forEach items="${requestScope.list2}" var="keyword" varStatus="id">
        ${id.index} ${keyword} ${keyword.name}${keyword.password}<br>
    </c:forEach>
    <br>
    <b>遍历List集合中第一个元素以后的元素（不包括第一个元素）：</b>
    <br>
    <c:forEach items="${requestScope.list2}" var="keyword" varStatus="id" begin="1">
        ${id.index} ${keyword} ${keyword.name}${keyword.password}<br>
    </c:forEach>


    <br>
    <br>
    <br>
    <br>
    <table>
        <tr>
            <td>name</td>
            <td>password</td>
            <td>用户姓名</td>
            <td>用户密码</td>
        </tr>



        <c:forEach items="${requestScope.list2}" var="keyword" varStatus="id" begin="1">
        <tr>
            <td>${id.index}</td>
            <td>${keyword}</td>
            <td>${keyword.name}</td>
            <td>${keyword.password}</td>
        </tr>
        </c:forEach>
    </table>


</body>
</html>
